//
//  ViewController.m
//  JSAPIDemo-iOS
//
//  Created by 蔡亮 on 2019/11/1.
//  Copyright © 2019 蔡亮. All rights reserved.
//

#import "ViewController.h"
#import <Masonry.h>
#import "FQSimpleWKWebVC.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.title = @"JSAPI";
    
    [self setupUI];
}
- (void)setupUI{
    UIButton *btn = [[UIButton alloc] init];
    [btn setTitle:@"开始测试JSAPI" forState:UIControlStateNormal];
    [btn setBackgroundColor:[UIColor orangeColor]];
    [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btn.layer.cornerRadius = 22;
    btn.layer.masksToBounds = YES;
    [btn addTarget:self action:@selector(onClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(0);
        make.size.mas_equalTo(CGSizeMake(300, 44));
    }];
}
- (void)onClick{
    FQSimpleWKWebVC *web = [[FQSimpleWKWebVC alloc] init];
    [web loadWebURLSring:@"https://www.baidu.com"];
    [self.navigationController pushViewController:web animated:YES];
}

@end
